<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="list" checkbox="true" fitColumns="true"
  	 title="教学大纲审核" actionUrl="teachOutlineController.do?auditDatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="大纲名称"  field="outlineName"  hidden="false" query="false"  queryMode="single"></t:dgCol>
   <t:dgCol title="适用课程"  field="lessonName"  hidden="false" query="false" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="适用专业"  field="majors"  hidden="false"  queryMode="single" query="false"  width="120"></t:dgCol>
   <t:dgCol title="所属学院"  field="college.collegeName"  hidden="false"  queryMode="single" query="false"  width="120"></t:dgCol>
   <t:dgCol title="总学时"  field="sumhours"  hidden="false"  queryMode="group" query="false"  width="120"></t:dgCol>
   <t:dgCol title="主撰稿人"  field="author"  hidden="false"  queryMode="single" query="false"  width="120"></t:dgCol>
   <t:dgCol title="撰写时间"  field="writeDate" formatter="yyyy-MM-dd hh:mm" queryMode="group"  query='false' width="120"></t:dgCol>
   <t:dgCol title="审稿人"  field="reviewer"  hidden="false"  queryMode="single" query="false"  width="120"></t:dgCol>
   <t:dgCol title="修改时间"  field="editDate" formatter="yyyy-MM-dd hh:mm" queryMode="group"  query='false' width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="180"></t:dgCol>
   <t:dgFunOpt funname="passApply(id)" title="审批通过"></t:dgFunOpt> 
   <t:dgFunOpt funname="fialPassApply(id)" title="审批不通过"></t:dgFunOpt> 
<%--    <t:dgToolBar title="编辑" icon="icon-edit" funname="edit"></t:dgToolBar> --%>
   <t:dgToolBar title="批量删除"  icon="icon-remove" url="teachOutlineController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
  </t:datagrid>
  </div>
 </div>
 <script>
	 function edit(){
	 	var rows = $("#list").datagrid('getSelections');
	 	if(rows.length==1){
			window.location.href='teachOutlineController.do?goAdd&id='+rows[0].id;	 
	 	}else{
	 		tip("请选择一行");
	 	}
	 }
	 function passApply(id){
			$.dialog.confirm('确定要审核通过吗?', function(r) {
				   if (r) { 
						$.ajax({
							url : 'teachOutlineController.do?doAudit&result=1&id='+id,
							type : 'post', 
							cache : false,
							success : function(data) {
								var d = $.parseJSON(data);
								if (d.success) {
									var msg = d.msg;
									tip(msg);
									reloadTable(); 
								}else{
									tip(msg);
								}
							}
						});
					}
				}); 
		}
		
		function fialPassApply(id){
			$.dialog.confirm('确定要审核不通过吗?', function(r) {
				   if (r) { 
						$.ajax({
							url : 'teachOutlineController.do?doAudit&result=0&id='+id,
							type : 'post', 
							cache : false,
							success : function(data) {
								var d = $.parseJSON(data);
								if (d.success) {
									var msg = d.msg;
									tip(msg);
									reloadTable(); 
								}else{
									tip(msg);
								}
							}
						});
					}
				}); 
		}
 </script>